import http from '../utils/http'
import qs from 'qs'

const rentopenid = 'oyc56w2PWiiob74WoZYgHVH0sLKg'

const params = qs.parse(window.location.hash.replace(/.+\?/, ''))

const get = (url, param) => http.get(`https://herb.yicanfan123.com/mobile/${url}`, Object.assign({
  rentopenid
}, param))

const getImgList = (albumId) => get('api_imglist.php', {
  albumId: params.albumId
})

const getApiInfo = (albumId) => get('api_site_info.php', {
  albumId: params.albumId
})

const getWxSdk = (url) => get('api_get_signpackage.php', {
  url
})

export {
  getImgList,
  getApiInfo,
  getWxSdk
}
